<template>
	<view>
		<view class="cont_Info">
			<!-- <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
				<view id="demo1" class="scroll-view-item_H uni-bg-red">A</view>
				<view id="demo2" class="scroll-view-item_H uni-bg-green">B</view>
				<view id="demo3" class="scroll-view-item_H uni-bg-blue">C</view>
			</scroll-view> -->
			 <!-- <scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="true" scroll-left="120"> -->
				<!-- <view class="cont">
					<rich-text :nodes="code" class="rich-text"/>
			    </view> -->
			          
			     <pre>
					<view class="cont">
						{{code}}
					</view> 
				 </pre>               
			<!-- </scroll-view> -->

			
			<!-- <scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="true" scroll-left="120"> -->
			<!-- </scroll-view> -->
		</view>
		<view class="read_btn" @click="readbtnFn">
			确认结算单
		</view>
	</view>
</template>

<script>
	import {addJieSuan} from '@/api/strategy.js'
	const dcRichAlert = uni.requireNativePlugin('Trader')
	export default {
		data() {
			return {
				code:'',
				account:''
			}
		},
		onLoad(){
			this.getConfirm()
		},
		onShow(){
			
		},
		methods: {
			getConfirm(){
				let that=this
				try{
					dcRichAlert.reqQrySettlementInfo({},function(res){
						that.account=res.data.investorID
						that.code=res.data.content
					})
				}catch(e){
					// error
				}
				
			},
			readbtnFn(){
				// addJieSuan({account:12132165}).then(res=>{
					
				// })
				let data={
					account:this.account
				}
				try{//结算单reqSettlementInfoConfirm
					dcRichAlert.reqSettlementInfoConfirm({},function(res){
						addJieSuan(data).then(res=>{
							getApp().globalData.isAccount=true
							setTimeout(()=>{
								uni.switchTab({
									url: '/pages/tabBar/transaction/index'
								});
							},500)
							
						})
						// uni.navigateBack()
					})
				}catch(e){
					// error
				}
			}
			// setTimeout(()=>{
			// 	try{
			// 	dcRichAlert.reqQrySettlementInfo({},function(res){
			// 		// 结算单
			// 	})
			// 	}catch(e){
			// 		// error
			// 	}
			// },500)				
				
			// setTimeout(()=>{
			// 	try{//结算单
			// 	dcRichAlert.reqQrySettlementInfoConfirm({},function(res){
			// 		// 确认结算单
			// 	})
			// 	}catch(e){
			// 		// error
			// 	}
			// },1000)
		}
	}
</script>

<style lang="scss" scoped>
	body{
		overflow-x:none !important;
	}
	uni-page-body{
		overflow-x:none !important;
	}
	.read_btn{
		width: 100%;
		height: 44px;
		line-height: 44px;
		background-color: #007AFF;
		text-align: center;
		color: #FFFFFF;
		font-size: 16px;
		position: fixed;
		left: 0;
		bottom: 0;
	}
	.cont_Info{
		/* position: absolute;
		top: 0;
		left: 0;
		// margin-bottom: 80px; */
		// overflow: hidden;
		margin: 20px;
		padding: 0 0 40px;
		box-sizing: border-box;
		.cont{
			display: block;
			width: 1050px;
			// text-align: center;
			overflow-x: scroll;
		}
	}
	.scroll-view_H {
		/* white-space: nowrap; */
		width: 100%;
	}
	.scroll-view-item_H {
		display: inline-block;
		width: 100%;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
		font-size: 36rpx;
	}
	/* .scroll-view_H{
		width: 1500px;
	} */
</style>
